import request from '@/utils/request'

export function fetchList (query) {
  return request({
    url: '/common/examine/all',
    method: 'get',
    params: query
  })
}

export function fetchArticle (id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}
export function preview (params) {
  return request({
    url: '/common/preview',
    method: 'get',
    params
  })
}
export function fetchPv (pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createArticle (data) {
  return request({
    url: '/admin/user',
    method: 'post',
    data
  })
}

export function updateArticle (data) {
  return request({
    url: '/common/examine/update',
    method: 'post',
    data
  })
}

export function delUser (params) {
  return request({
    url: '/user/deluser',
    method: 'delete',
    params
  })
}
